
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="commonheader">
    <!--common-->
    <link href="css/style.css" th:href="@{/css/style.css}" rel="stylesheet">
    <!-- 响应式样式 -->
    <link href="css/style-responsive.css" th:href="@{/css/style-responsive.css}" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js" th:src="@{/js/html5shiv.js}"></script>
    <script src="js/respond.min.js" th:src="@{/js/respond.min.js}"></script>

    <![endif]-->
</head>
<body>

<!-- 左侧开始-->
<div th:fragment="leftmenu" class="left-side sticky-left-side" tabindex="5000" style="overflow: hidden; outline: none;">

    <!--logo and iconic logo start-->
    <div class="logo">
        <a th:href="@{/index.html}">
            <img src="images/logo.png" alt=""></a>
    </div>

    <div class="logo-icon text-center">
        <a th:href="@{/index.html}">
            <img src="images/logo_icon.png" alt=""></a>
    </div>
    <!--logo and iconic logo end-->

    <div class="left-side-inner">

        <!-- 头部用户个人操作 -->
        <div class="visible-xs hidden-sm hidden-md hidden-lg">
            <div class="media logged-user">
                <img alt="" src="images/photos/user-avatar.png" class="media-object">
                <div class="media-body">
                    <h4>
                        <a href="#"> [[${session.loginUser.adminname}]]</a>
                    </h4>
                    <span>"你好啊..."</span>
                </div>
            </div>

            <h5 class="left-nav-title">账户信息</h5>
            <ul class="nav nav-pills nav-stacked custom-nav">
                <li>
                    <a >
                        <i class="fa fa-user"></i>

                        个人信息
                    </a>
                </li>
                <li>
                    <a data-toggle="modal" data-target="#admin" > <i class="fa fa-user"></i>
                        <span>修改密码</span>
                    </a>
                </li>

                <li>
                    <a th:href="@{/out}">
                        <i class="fa fa-sign-out"></i>
                        <span>退出</span>
                    </a>
                </li>
            </ul>
        </div>

        <!--侧边栏导航开始-->
        <ul class="nav nav-pills nav-stacked custom-nav">
            <li class="menu-list">
                <a href="index.html">
                    <i class="fa fa-home"></i>
                    <span>指示板</span>
                </a>
                <ul class="sub-menu-list">
                    <li class="">
                        <a th:href="@{/index.html}">指示板 1</a>
                    </li>
                    <li>
                        <a th:href="@{/index_alt.html}">指示板 2</a>
                    </li>
                </ul>
            </li>




            <li class="menu-list  nav-active">
                <a href="#">
                    <i class="fa fa-th-list"></i>
                    <span>管理</span>
                </a>
                <ul class="sub-menu-list">
                    <li class="active">

                        <a th:href="@{/editable_table}" >图书表</a>
                    </li>
                    <li>
                        <a th:href="@{/order_table}" >订单表</a>
                    </li>
                    <li>
                        <a th:href="@{/user_table}" >用户表</a>
                    </li>
                    <li>
                        <a th:href="@{/admin_table}" >管理员</a>
                    </li>
                </ul>
            </li>




        </ul>
        <!--侧边栏导航结束--> </div>
</div>
<!-- 左侧结束-->


<!-- 登录模态框（Modal） -->
<!-- /.modal-content -->


<!-- 头部分开始-->
<div th:fragment="headermenu" class="header-section">

    <!--开关按钮开始-->
    <a class="toggle-btn">
        <i class="fa fa-bars"></i>
    </a>
    <!--开关按钮结束-->

    <!--搜索开始-->

    <!--搜索结束-->

    <!--通知菜单开始 -->
    <form class="searchform" action="http://view.jqueryfuns.com/2014/4/10/7_df25ceea231ba5f44f0fc060c943cdae/index.html" method="post">
        <input type="text" class="form-control" name="keyword" placeholder="Search here...">
    </form><div class="menu-right">
    <ul class="notification-menu">
        <li>
            <a href="#" class="btn btn-default dropdown-toggle info-number" data-toggle="dropdown">
                <i class="fa fa-tasks"></i>
                <span class="badge">8</span>
            </a>
            <div class="dropdown-menu dropdown-menu-head pull-right">
                <h5 class="title">你有八个未解决的问题</h5>
                <ul class="dropdown-list user-list">
                    <li class="new">
                        <a href="#">
                            <div class="task-info">
                                <div>数据库更新</div>
                            </div>
                            <div class="progress progress-striped">
                                <div style="width: 40%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="40" role="progressbar" class="progress-bar progress-bar-warning">
                                    <span class="">40%</span>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li class="new">
                        <a href="#">
                            <div class="task-info">
                                <div>test2</div>
                            </div>
                            <div class="progress progress-striped">
                                <div style="width: 90%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="90" role="progressbar" class="progress-bar progress-bar-success">
                                    <span class="">90%</span>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="#">
                            <div class="task-info">
                                <div>test2</div>
                            </div>
                            <div class="progress progress-striped">
                                <div style="width: 66%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="66" role="progressbar" class="progress-bar progress-bar-info">
                                    <span class="">66%</span>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="#">
                            <div class="task-info">
                                <div>test2</div>
                            </div>
                            <div class="progress progress-striped">
                                <div style="width: 33%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="33" role="progressbar" class="progress-bar progress-bar-danger">
                                    <span class="">33%</span>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li>
                        <a href="#">
                            <div class="task-info">
                                <div>test2</div>
                            </div>
                            <div class="progress progress-striped">
                                <div style="width: 80%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="80" role="progressbar" class="progress-bar">
                                    <span class="">80%</span>
                                </div>
                            </div>
                        </a>
                    </li>
                    <li class="new">
                        <a href="">看到所有未解决任务</a>
                    </li>
                </ul>
            </div>
        </li>
        <li>
            <a href="#" class="btn btn-default dropdown-toggle info-number" data-toggle="dropdown">
                <i class="fa fa-envelope-o"></i>
                <span class="badge">5</span>
            </a>
            <div class="dropdown-menu dropdown-menu-head pull-right">
                <h5 class="title">你有5封邮件</h5>
                <ul class="dropdown-list normal-list">
                    <li class="new">
                        <a href="">
                                            <span class="thumb">
                                                <img src="images/photos/user1.png" alt="">
                                            </span>
                            <span class="desc">
                                                <span class="name">
                                                    管理员
                                                    <span class="badge badge-success">new</span>
                                                </span>
                                                <span class="msg">测试数据...</span>
                                            </span>
                        </a>
                    </li>
                    <li>
                        <a href="">
                                            <span class="thumb">
                                                <img src="images/photos/user2.png" alt="">
                                            </span>
                            <span class="desc">
                                                <span class="name">管理员</span>
                                                <span class="msg">测试数据...</span>
                                            </span>
                        </a>
                    </li>
                    <li>
                        <a href="">
                                            <span class="thumb">
                                                <img src="images/photos/user3.png" alt="">
                                            </span>
                            <span class="desc">
                                                <span class="name">管理员</span>
                                                <span class="msg">测试数据...</span>
                                            </span>
                        </a>
                    </li>
                    <li>
                        <a href="">
                                            <span class="thumb">
                                                <img src="images/photos/user4.png" alt="">
                                            </span>
                            <span class="desc">
                                                <span class="name">管理员</span>
                                                <span class="msg">测试数据...</span>
                                            </span>
                        </a>
                    </li>
                    <li>
                        <a href="">
                                            <span class="thumb">
                                                <img src="images/photos/user5.png" alt="">
                                            </span>
                            <span class="desc">
                                                <span class="name">管理员</span>
                                                <span class="msg">测试数据...</span>
                                            </span>
                        </a>
                    </li>
                    <li class="new">
                        <a href="">阅读所有的邮件</a>
                    </li>
                </ul>
            </div>
        </li>
        <li>
            <a href="#" class="btn btn-default dropdown-toggle info-number" data-toggle="dropdown">
                <i class="fa fa-bell-o"></i>
                <span class="badge">4</span>
            </a>
            <div class="dropdown-menu dropdown-menu-head pull-right">
                <h5 class="title">通知</h5>
                <ul class="dropdown-list normal-list">
                    <li class="new">
                        <a href="">
                                            <span class="label label-danger">
                                                <i class="fa fa-bolt"></i>
                                            </span>
                            <span class="name">服务器# 1超载.</span> <em class="small">34 mins</em>
                        </a>
                    </li>
                    <li class="new">
                        <a href="">
                                            <span class="label label-danger">
                                                <i class="fa fa-bolt"></i>
                                            </span>
                            <span class="name">服务器# 1超载.</span> <em class="small">1 hrs</em>
                        </a>
                    </li>
                    <li class="new">
                        <a href="">
                                            <span class="label label-danger">
                                                <i class="fa fa-bolt"></i>
                                            </span>
                            <span class="name">服务器# 1超载.</span>
                            <em class="small">4 hrs</em>
                        </a>
                    </li>
                    <li class="new">
                        <a href="">
                                            <span class="label label-danger">
                                                <i class="fa fa-bolt"></i>
                                            </span>
                            <span class="name">服务器# 1超载.</span>
                            <em class="small">4 hrs</em>
                        </a>
                    </li>
                    <li class="new">
                        <a href="">看到所有的通知</a>
                    </li>
                </ul>
            </div>
        </li>
        <li>
            <a href="#" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                <img src="images/photos/user-avatar.png" alt="">
                [[${session.loginUser.adminname}]]
                <span class="caret"></span>
            </a>
            <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                <li>
                    <a >
                        <i class="fa fa-user"></i>

                        个人信息
                    </a>
                </li>
                <li>
                    <a data-toggle="modal" data-target="#admin">
                        <i class="fa fa-user"></i>

                        修改密码
                    </a>
                </li>

                <li>
                    <a th:href="@{/out}">
                        <i class="fa fa-sign-out"></i>
                        推出
                    </a>
                </li>
            </ul>
        </li>

    </ul>

</div>


    <!--通知菜单结束 --> </div>

<!-- 头部分结束-->

<div th:fragment="adminname1" class="modal fade" id="admin" style="z-index: 2041" tabindex="-1" role="dialog" aria-labelledby="adminLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="loginModalLabel">
                    修改密码
                </h4>
            </div>
            <div class="modal-body"   >
                <!--登录的form表单-->
                <form id="adminloginForm" class="form-horizontal" role="form" action="" autocomplete="off">

                    <div class="form-group has-feedback" >
                        <label class="col-sm-2 control-label">密码</label>
                        <div  class="col-sm-5">
                            <input  type="password" autocomplete="off" class="form-control" name="adminpassword1" id="adminpassword1" placeholder="输入密码">
                        </div>

                    </div>
                    <div class="form-group has-feedback">
                        <label class="col-sm-2 control-label">确认密码</label>
                        <div class="col-sm-5" >
                            <input th:onblur="|adminword()|" autocomplete="off"  type="password" class="form-control" name="adminpassword" id="adminpassword"  placeholder="再次输入密码">


                        </div>
                        <div class="col-sm-3" id="adminpwTip" style="padding-top: 10px;display: none">
                            <label class="alert-danger">密码一致</label>
                        </div>

                        <div class="col-sm-3" id="adminpwdTip" style="padding-top: 10px;display: none">
                            <label class="alert-danger" id="tip">密码不一致</label>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <input type="button" class="btn btn-primary" value="修改" th:onclick="|adminlogin()|">
                    </div>
                </form>
                <!--form结束-->
            </div>
        </div>
    </div>
</div>


<div  th:fragment="commonscript">
    <!-- 最后把js文件的页面加载速度 -->
    <script th:src="@{/js/jquery-1.10.2.min.js}"></script>
    <script th:src="@{/js/jquery-ui-1.9.2.custom.min.js}"></script>
    <script th:src="@{/js/jquery-migrate-1.2.1.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/js/modernizr.min.js}"></script>
    <script th:src="@{/js/jquery.nicescroll.js}"></script>
    <!--常见的所有页面的脚本-->
    <script th:src="@{/js/scripts.js}"></script>
    <script type="text/javascript">
        //绑定模态框的id
        $("#admin").modal("hide");
        function adminword() {

            var adminpassword1 =  document.getElementById("adminpassword1").value;
            var adminpassword =  document.getElementById("adminpassword").value;
            if (adminpassword==adminpassword1){
                $("#adminpwTip").css("display","block");
                $("#adminpwdTip").css("display","none");
            }else {
                $("#adminpwdTip").css("display","block");
                $("#adminpwTip").css("display","none");
            }
        }

        function adminlogin(){
            var adminpassword1 =  document.getElementById("adminpassword1").value;
            var adminpassword =  document.getElementById("adminpassword").value;

            if (adminpassword==adminpassword1){

                //执行修改
                window.location.href = "upadmin?password="+adminpassword;
            }else {
                alert("密码不一致");
            }
        }
    </script>

</div>

</body>
</html>